Add STL iterator capabilities to surface::RangeIteratorBase<T> and surface::NavigationIteratorBase<T>#130
Open
bjude wants to merge 2 commits intonmwsharp:masterfrom
Open
Add STL iterator capabilities to surface::RangeIteratorBase<T> and surface::NavigationIteratorBase<T>#130bjude wants to merge 2 commits intonmwsharp:masterfrom
bjude wants to merge 2 commits intonmwsharp:masterfrom
Conversation
…requirements This allows the various set ranges to be used with std algorithms. These iterators differ from the LegacyForwardIterator requirements (https://en.cppreference.com/w/cpp/named_req/ForwardIterator) in a couple of ways - No operator->: Since these iterators construct their elements on dereference, theres not safe way to return pointer to one outside of using a proxy object. Operator-> isnt required for c++20's std::input_iterator concept so shouldnt be an issue for std algorithms - std::iterator_traits<RangeIteratorBase<T>>::reference is not a reference: Similar reasoning to above, it could be defined as `const value_type&` but that could be asking for a dangling reference. This is also not a requirement for c++20's std::forward_iterator
…ator requirements The `const bool` in `VertexNeighborIteratorState` was causing the default constructor for `NavigationIteratorBase<VertexAdjacentVertexNavigator>` and friends by implicitly deleting default constructors up the chain. This was solved by making the member variables private and adding `const` accessors. The functionality of the class should be the same, just a few renamings to avoid clashes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main iterators for the halfedge meshes were almost forward iterators, this PR gets them to a usable state. They dont quite meet the LegacyForwardIterator requirements (https://en.cppreference.com/w/cpp/named_req/ForwardIterator) as they generate their elements on dereference, but they do meet the C++20
std::forward_iteratorrequirements so there shouldnt be any issue using them with STL algorithms (including C++20 ranges)Closes #76